1. Field of the Invention
This invention relates in general to computer-implemented database management systems, and, in particular, to improving database recovery time after a system failure.
2. Description of the Related Art
Database management systems (DBMSs) are computerized information storage and retrieval systems. Relational database management systems (RDBMSs) are DBMSs that store and retrieve data that is organized as tables. A table consists of rows and columns of data. The rows are formally called tuples. A database will typically have many tables and each table will typically have multiple tuples and multiple columns.
A common technique for storing a database in a data storage device is to assign each table to a tablespace. A tablespace is a named collection of one or more datasets. Each tablespace is physically divided into equal units called data pages, and each data page contains one or more tuples of data.
DBMSs are susceptible to data loss after a system failure. To prevent such a data loss, DBMSs usually copy the database from a volatile storage device to a non-volatile storage device, such as a direct access storage device (DASD). Additionally, as data changes occur, DBMSs commonly record these changes in a recovery log. A recovery log is a list of time-ordered actions that indicate what changes were made to the database and in what order those changes were made. The recovery log may be stored in a data storage device, such as DASD or a buffer.
As shown in FIG. 1, prior art recovery techniques generally involve reading a log 102 and applying the log records 104 to an associated data page or data page set 106. Specifically, the data page 106 is read from a buffer or from the DASD, and required changes are made to the data page 106. This process is repeated until all the data pages 106 are read, and the database is restored to the state it was in before the system failure. Because many different log records 104 can apply to the same data page 106, a data page 106 may be read many times. Reading a data page 106 multiple times increases the number of input/output operations and increases the log apply time. Thus, there is a need for an improved recovery technique.